package com.lixinyue.array;

import java.util.Scanner;

public class Demo01 {
    public static void main(String[] args) {
        System.out.print("请输入学生人数：");
        Scanner scan = new Scanner(System.in);
        int num= scan.nextInt();
        int[] arr = new int[num];
        int max=arr[0];
        for (int i = 0; i < arr.length ; i++) {
           arr[i]= scan.nextInt();
           if(arr[i]>max)
           {
               max=arr[i];
           }
        }
        System.out.println("最高分是:"+max);
        for (int i = 0; i < arr.length; i++) {
            if(arr[i]>=(max-10))
            {
                System.out.println("student"+i+"score is"+arr[i]+"grade is"+'A');
            }
            else if(arr[i]>=(max-20))
            {
                System.out.println("student"+i+"score is"+arr[i]+"grade is"+'B');
            }
            else if(arr[i]>=(max-30))
            {
                System.out.println("student"+i+"score is"+arr[i]+"grade is"+'C');
            }
           else

                System.out.println("student"+i+"score is"+arr[i]+"grade is"+'D');

        }
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]+"\t");
        }
    }
}
